<?php
/* @var $this ProductController */
/* @var $model Product */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'产品管理'=>array($this->pre_module_url.'/productSale/admin'),
	'待审核的产品'=>array($this->pre_module_url.'/productSale/admin'),
	'产品审核'
);
$member = Member::model()->findByPk($model->zm_id);
$company = Company::model()->findByPk($model->zm_id);
?>
<div class="product_info">
	<div class="mem_info c_f">
		<p>网铺名称：<?php echo $company->zc_name?></p>
		<p>会员名称：<?php echo $member->zm_name?></p>
	</div>
	<div class="info">
		<ul>
			<li>
				<span class="tit">产品标题：</span>
				<a href="javascript:"><?php echo $model->zp_name?></a>			
			</li>
			<li>
				<span class="tit">产品价格：</span>
				<a href="javascript:"><?php echo $model->zp_price?></a>			
			</li>
			<li>
				<span class="tit">产品规格：</span>
				<span class="content">
				<ul>
				<?php if(!empty($model->standard)){foreach($model->standard as $val){?>
                    <li><?php echo $val->attribute->za_title?>： <?php echo $val->zpa_val?></li>
                <?php }}?>
                </ul></span>
            <li>
				<span class="tit">产品属性：</span>
				<span class="content"><ul>
                <?php if(!empty($model->attribute)){foreach($model->attribute as $val){?>
                    <li><?php echo $val->attribute->za_title?>： <?php echo $val->zpa_val?></li>
                <?php }}?>
                </ul></span>
			</li>
			<li>
				<span class="tit">产品图片：</span>
				<span class="content_img"><ul>
				<?php if(!empty($model->proimg)){ foreach($model->proimg as $val){?>
                    <li><?php echo Tool::thumb($val->zpg_url,100,100,$model->zp_name,array('class'=>'img'))?></li>
                <?php }}?>
                </ul></span>
             </li>
             <li>
				<span class="tit">产品描述：</span>
				<span class="content">						
				<?php  $this->widget('ext.keditor.KEditor',array(
				            'model'=>$model,  //传入form model
				            'name'=>'zp_content', //设置name
				            'properties'=>array(
				                //设置接收文件上传的action
				                'uploadJson'=>'/Attachment/GetAjax',
				                //设置浏览服务器文件的action，这两个就是上面配置在/admin/default的
				             //   'fileManagerJson'=>'/Attachment/GetAjax',
				                'newlineTag'=>'br',
				                'allowFileManager'=>true,
				                //传值前加js:来标记这些是js代码
				                'afterCreate'=>"js:function() {
				                        K('#ChapterForm_all_len').val(this.count());
				                        K('#ChapterForm_word_len').val(this.count('text'));
				                    }",
				                'afterChange'=>"js:function() {
				                        K('#ChapterForm_all_len').val(this.count());
				                        K('#ChapterForm_word_len').val(this.count('text'));
				                    }",
				            ),
				            'textareaOptions'=>array(
				                'style'=>'width:685px;height:261px;',
				            )
				 )); ?>
                </span>			
            </li>
            <?php $form=$this->beginWidget('CActiveForm', array(
				'id'=>'CompanyCard-form',
				'enableAjaxValidation'=>false,
			)); ?>

            <li>
            	<span class="tit" >审核说明:</span>	
            	<span class="content">							
            	<p class="c_999">如果审核通过，则无需填写审核说明，如果不通过，需写明不通过的原因</p>
						<?php echo $form->textArea($model,'zp_nostatus',array('class'=>'t_area','cols'=>100,'rows'=>5))?>
				</span>
            </li>
           <li>
            	<span class="tit" >&nbsp;</span>	
            	<span class="content">							
	            	<?php echo CHtml::submitButton('审核通过',array('class'=>'mem_btn mem_btn06','name'=>'pass'))?>
	            	<?php echo CHtml::submitButton('不通过',array('class'=>'mem_btn mem_btn07','name'=>'onpass','onclick'=>'return checkSubmit() '))?>
				</span>
            </li>
            <?php $this->endWidget(); ?>   	 
		</ul>
	</div>
</div>

<script type="text/javascript">
	function checkSubmit(){
		if($("#Product_zp_nostatus").val().length<1){
			alert("审核不通过，请输入不通过的理由！");
			return false;
		}else{
			return true;
		}
	}
</script>